Optimal. Leaf size=115 \[ -\frac {a+b \tanh ^{-1}(c+d x)}{f (e+f x)}-\frac {b d \log (1-c-d x)}{2 f (d e+f-c f)}+\frac {b d \log (1+c+d x)}{2 f (d e-f-c f)}-\frac {b d \log (e+f x)}{(d e+f-c f) (d e-(1+c) f)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {6244, 2007,
719, 31, 646} \begin {gather*} -\frac {a+b \tanh ^{-1}(c+d x)}{f (e+f x)}-\frac {b d \log (-c-d x+1)}{2 f (-c f+d e+f)}+\frac {b d \log (c+d x+1)}{2 f (-c f+d e-f)}-\frac {b d \log (e+f x)}{(-c f+d e+f) (d e-(c+1) f)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 646
Rule 719
Rule 2007
Rule 6244
Rubi steps
\begin {align*} \int \frac {a+b \tanh ^{-1}(c+d x)}{(e+f x)^2} \, dx &=-\frac {a+b \tanh ^{-1}(c+d x)}{f (e+f x)}+\frac {(b d) \int \frac {1}{(e+f x) \left (1-(c+d x)^2\right )} \, dx}{f}\\ &=-\frac {a+b \tanh ^{-1}(c+d x)}{f (e+f x)}+\frac {(b d) \int \frac {1}{(e+f x) \left (1-c^2-2 c d x-d^2 x^2\right )} \, dx}{f}\\ &=-\frac {a+b \tanh ^{-1}(c+d x)}{f (e+f x)}+\frac {(b d) \int \frac {-d^2 e+2 c d f+d^2 f x}{1-c^2-2 c d x-d^2 x^2} \, dx}{f \left (-d^2 e^2+2 c d e f+\left (1-c^2\right ) f^2\right )}+\frac {(b d f) \int \frac {1}{e+f x} \, dx}{-d^2 e^2+2 c d e f+\left (1-c^2\right ) f^2}\\ &=-\frac {a+b \tanh ^{-1}(c+d x)}{f (e+f x)}-\frac {b d \log (e+f x)}{(d e-f-c f) (d e+f-c f)}-\frac {\left (b d^3\right ) \int \frac {1}{-d-c d-d^2 x} \, dx}{2 f (d e-f-c f)}+\frac {\left (b d^3\right ) \int \frac {1}{d-c d-d^2 x} \, dx}{2 f (d e+f-c f)}\\ &=-\frac {a+b \tanh ^{-1}(c+d x)}{f (e+f x)}-\frac {b d \log (1-c-d x)}{2 f (d e+f-c f)}+\frac {b d \log (1+c+d x)}{2 f (d e-f-c f)}-\frac {b d \log (e+f x)}{(d e-f-c f) (d e+f-c f)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.13, size = 125, normalized size = 1.09 \begin {gather*} \frac {1}{2} \left (-\frac {2 a}{f (e+f x)}-\frac {2 b \tanh ^{-1}(c+d x)}{f (e+f x)}+\frac {b d \log (1-c-d x)}{f (-d e+(-1+c) f)}-\frac {b d \log (1+c+d x)}{f (-d e+f+c f)}-\frac {2 b d \log (e+f x)}{d^2 e^2-2 c d e f+\left (-1+c^2\right ) f^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.76, size = 170, normalized size = 1.48
method | result | size |
derivativedivides | \(\frac {\frac {a \,d^{2}}{\left (c f -d e -f \left (d x +c \right )\right ) f}+\frac {b \,d^{2} \arctanh \left (d x +c \right )}{\left (c f -d e -f \left (d x +c \right )\right ) f}-\frac {b \,d^{2} \ln \left (d x +c +1\right )}{f \left (2 c f -2 d e +2 f \right )}-\frac {b \,d^{2} \ln \left (c f -d e -f \left (d x +c \right )\right )}{\left (c f -d e -f \right ) \left (c f -d e +f \right )}+\frac {b \,d^{2} \ln \left (d x +c -1\right )}{f \left (2 c f -2 d e -2 f \right )}}{d}\) | \(170\) |
default | \(\frac {\frac {a \,d^{2}}{\left (c f -d e -f \left (d x +c \right )\right ) f}+\frac {b \,d^{2} \arctanh \left (d x +c \right )}{\left (c f -d e -f \left (d x +c \right )\right ) f}-\frac {b \,d^{2} \ln \left (d x +c +1\right )}{f \left (2 c f -2 d e +2 f \right )}-\frac {b \,d^{2} \ln \left (c f -d e -f \left (d x +c \right )\right )}{\left (c f -d e -f \right ) \left (c f -d e +f \right )}+\frac {b \,d^{2} \ln \left (d x +c -1\right )}{f \left (2 c f -2 d e -2 f \right )}}{d}\) | \(170\) |
risch | \(-\frac {b \ln \left (d x +c +1\right )}{2 f \left (f x +e \right )}-\frac {\ln \left (d x +c +1\right ) b c d \,f^{2} x -\ln \left (d x +c +1\right ) b \,d^{2} e f x -\ln \left (-d x -c +1\right ) b c d \,f^{2} x +\ln \left (-d x -c +1\right ) b \,d^{2} e f x +\ln \left (d x +c +1\right ) b c d e f -\ln \left (d x +c +1\right ) b \,d^{2} e^{2}-\ln \left (d x +c +1\right ) b d \,f^{2} x +\ln \left (-d x -c +1\right ) b c d e f -\ln \left (-d x -c +1\right ) b d \,f^{2} x +2 \ln \left (-f x -e \right ) b d \,f^{2} x -b \,c^{2} f^{2} \ln \left (-d x -c +1\right )-\ln \left (d x +c +1\right ) b d e f -\ln \left (-d x -c +1\right ) b d e f +2 \ln \left (-f x -e \right ) b d e f +2 a \,c^{2} f^{2}-4 a c d e f +2 d^{2} e^{2} a +b \,f^{2} \ln \left (-d x -c +1\right )-2 a \,f^{2}}{2 \left (c f -d e +f \right ) \left (c f -d e -f \right ) \left (f x +e \right ) f}\) | \(331\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 128, normalized size = 1.11 \begin {gather*} -\frac {1}{2} \, {\left (d {\left (\frac {\log \left (d x + c + 1\right )}{{\left (c + 1\right )} f^{2} - d f e} - \frac {\log \left (d x + c - 1\right )}{{\left (c - 1\right )} f^{2} - d f e} - \frac {2 \, \log \left (f x + e\right )}{2 \, c d f e - {\left (c^{2} - 1\right )} f^{2} - d^{2} e^{2}}\right )} + \frac {2 \, \operatorname {artanh}\left (d x + c\right )}{f^{2} x + f e}\right )} b - \frac {a}{f^{2} x + f e} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 517 vs.
\(2 (118) = 236\).
time = 0.50, size = 517, normalized size = 4.50 \begin {gather*} \frac {4 \, a c d f \cosh \left (1\right ) - 2 \, a d^{2} \cosh \left (1\right )^{2} - 2 \, a d^{2} \sinh \left (1\right )^{2} - 2 \, {\left (a c^{2} - a\right )} f^{2} - {\left ({\left (b c - b\right )} d f^{2} x - b d^{2} \cosh \left (1\right )^{2} - b d^{2} \sinh \left (1\right )^{2} - {\left (b d^{2} f x - {\left (b c - b\right )} d f\right )} \cosh \left (1\right ) - {\left (b d^{2} f x + 2 \, b d^{2} \cosh \left (1\right ) - {\left (b c - b\right )} d f\right )} \sinh \left (1\right )\right )} \log \left (d x + c + 1\right ) + {\left ({\left (b c + b\right )} d f^{2} x - b d^{2} \cosh \left (1\right )^{2} - b d^{2} \sinh \left (1\right )^{2} - {\left (b d^{2} f x - {\left (b c + b\right )} d f\right )} \cosh \left (1\right ) - {\left (b d^{2} f x + 2 \, b d^{2} \cosh \left (1\right ) - {\left (b c + b\right )} d f\right )} \sinh \left (1\right )\right )} \log \left (d x + c - 1\right ) - 2 \, {\left (b d f^{2} x + b d f \cosh \left (1\right ) + b d f \sinh \left (1\right )\right )} \log \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + {\left (2 \, b c d f \cosh \left (1\right ) - b d^{2} \cosh \left (1\right )^{2} - b d^{2} \sinh \left (1\right )^{2} - {\left (b c^{2} - b\right )} f^{2} + 2 \, {\left (b c d f - b d^{2} \cosh \left (1\right )\right )} \sinh \left (1\right )\right )} \log \left (-\frac {d x + c + 1}{d x + c - 1}\right ) + 4 \, {\left (a c d f - a d^{2} \cosh \left (1\right )\right )} \sinh \left (1\right )}{2 \, {\left ({\left (c^{2} - 1\right )} f^{4} x + d^{2} f \cosh \left (1\right )^{3} + d^{2} f \sinh \left (1\right )^{3} + {\left (d^{2} f^{2} x - 2 \, c d f^{2}\right )} \cosh \left (1\right )^{2} + {\left (d^{2} f^{2} x - 2 \, c d f^{2} + 3 \, d^{2} f \cosh \left (1\right )\right )} \sinh \left (1\right )^{2} - {\left (2 \, c d f^{3} x - {\left (c^{2} - 1\right )} f^{3}\right )} \cosh \left (1\right ) - {\left (2 \, c d f^{3} x - 3 \, d^{2} f \cosh \left (1\right )^{2} - {\left (c^{2} - 1\right )} f^{3} - 2 \, {\left (d^{2} f^{2} x - 2 \, c d f^{2}\right )} \cosh \left (1\right )\right )} \sinh \left (1\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 1658 vs.
\(2 (92) = 184\).
time = 4.62, size = 1658, normalized size = 14.42 \begin {gather*} \begin {cases} - \frac {a + b \operatorname {atanh}{\left (c \right )}}{e f + f^{2} x} & \text {for}\: d = 0 \\- \frac {2 a f}{2 e f^{2} + 2 f^{3} x} + \frac {b d e \operatorname {atanh}{\left (\frac {d e}{f} + d x - 1 \right )}}{2 e f^{2} + 2 f^{3} x} + \frac {b d f x \operatorname {atanh}{\left (\frac {d e}{f} + d x - 1 \right )}}{2 e f^{2} + 2 f^{3} x} - \frac {2 b f \operatorname {atanh}{\left (\frac {d e}{f} + d x - 1 \right )}}{2 e f^{2} + 2 f^{3} x} - \frac {b f}{2 e f^{2} + 2 f^{3} x} & \text {for}\: c = \frac {d e - f}{f} \\- \frac {2 a f}{2 e f^{2} + 2 f^{3} x} - \frac {b d e \operatorname {atanh}{\left (\frac {d e}{f} + d x + 1 \right )}}{2 e f^{2} + 2 f^{3} x} - \frac {b d f x \operatorname {atanh}{\left (\frac {d e}{f} + d x + 1 \right )}}{2 e f^{2} + 2 f^{3} x} - \frac {2 b f \operatorname {atanh}{\left (\frac {d e}{f} + d x + 1 \right )}}{2 e f^{2} + 2 f^{3} x} + \frac {b f}{2 e f^{2} + 2 f^{3} x} & \text {for}\: c = \frac {d e + f}{f} \\\tilde {\infty } \left (a x + \frac {b c \operatorname {atanh}{\left (c + d x \right )}}{d} + b x \operatorname {atanh}{\left (c + d x \right )} + \frac {b \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{d} - \frac {b \operatorname {atanh}{\left (c + d x \right )}}{d}\right ) & \text {for}\: e = - f x \\\frac {a x + \frac {b c \operatorname {atanh}{\left (c + d x \right )}}{d} + b x \operatorname {atanh}{\left (c + d x \right )} + \frac {b \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{d} - \frac {b \operatorname {atanh}{\left (c + d x \right )}}{d}}{e^{2}} & \text {for}\: f = 0 \\- \frac {a c^{2} f^{2}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} + \frac {2 a c d e f}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} - \frac {a d^{2} e^{2}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} + \frac {a f^{2}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} - \frac {b c^{2} f^{2} \operatorname {atanh}{\left (c + d x \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} + \frac {b c d e f \operatorname {atanh}{\left (c + d x \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} - \frac {b c d f^{2} x \operatorname {atanh}{\left (c + d x \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} + \frac {b d^{2} e f x \operatorname {atanh}{\left (c + d x \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} - \frac {b d e f \log {\left (\frac {e}{f} + x \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} + \frac {b d e f \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} - \frac {b d e f \operatorname {atanh}{\left (c + d x \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} - \frac {b d f^{2} x \log {\left (\frac {e}{f} + x \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} + \frac {b d f^{2} x \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} - \frac {b d f^{2} x \operatorname {atanh}{\left (c + d x \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} + \frac {b f^{2} \operatorname {atanh}{\left (c + d x \right )}}{c^{2} e f^{3} + c^{2} f^{4} x - 2 c d e^{2} f^{2} - 2 c d e f^{3} x + d^{2} e^{3} f + d^{2} e^{2} f^{2} x - e f^{3} - f^{4} x} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 474 vs.
\(2 (112) = 224\).
time = 0.43, size = 474, normalized size = 4.12 \begin {gather*} -\frac {1}{2} \, {\left ({\left (c + 1\right )} d - {\left (c - 1\right )} d\right )} {\left (\frac {b \log \left (-\frac {{\left (d x + c + 1\right )} d e}{d x + c - 1} + d e + \frac {{\left (d x + c + 1\right )} c f}{d x + c - 1} - c f - \frac {{\left (d x + c + 1\right )} f}{d x + c - 1} - f\right )}{d^{2} e^{2} - 2 \, c d e f + c^{2} f^{2} - f^{2}} - \frac {b \log \left (-\frac {d x + c + 1}{d x + c - 1}\right )}{\frac {{\left (d x + c + 1\right )} d^{2} e^{2}}{d x + c - 1} - d^{2} e^{2} - \frac {2 \, {\left (d x + c + 1\right )} c d e f}{d x + c - 1} + 2 \, c d e f + \frac {{\left (d x + c + 1\right )} c^{2} f^{2}}{d x + c - 1} - c^{2} f^{2} + \frac {2 \, {\left (d x + c + 1\right )} d e f}{d x + c - 1} - \frac {2 \, {\left (d x + c + 1\right )} c f^{2}}{d x + c - 1} + \frac {{\left (d x + c + 1\right )} f^{2}}{d x + c - 1} + f^{2}} - \frac {b \log \left (-\frac {d x + c + 1}{d x + c - 1}\right )}{d^{2} e^{2} - 2 \, c d e f + c^{2} f^{2} - f^{2}} - \frac {2 \, a}{\frac {{\left (d x + c + 1\right )} d^{2} e^{2}}{d x + c - 1} - d^{2} e^{2} - \frac {2 \, {\left (d x + c + 1\right )} c d e f}{d x + c - 1} + 2 \, c d e f + \frac {{\left (d x + c + 1\right )} c^{2} f^{2}}{d x + c - 1} - c^{2} f^{2} + \frac {2 \, {\left (d x + c + 1\right )} d e f}{d x + c - 1} - \frac {2 \, {\left (d x + c + 1\right )} c f^{2}}{d x + c - 1} + \frac {{\left (d x + c + 1\right )} f^{2}}{d x + c - 1} + f^{2}}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.64, size = 170, normalized size = 1.48 \begin {gather*} \ln \left (e+f\,x\right )\,\left (\frac {b\,\left (c-1\right )}{2\,e\,\left (d\,e-f\,\left (c-1\right )\right )}-\frac {b\,\left (c+1\right )}{2\,e\,\left (d\,e-f\,\left (c+1\right )\right )}\right )-\frac {a}{x\,f^2+e\,f}+\frac {b\,\ln \left (1-d\,x-c\right )}{f\,\left (2\,e+2\,f\,x\right )}-\frac {b\,\ln \left (c+d\,x+1\right )}{2\,f\,\left (e+f\,x\right )}-\frac {b\,d\,\ln \left (c+d\,x-1\right )}{2\,f^2-2\,c\,f^2+2\,d\,e\,f}-\frac {b\,d\,\ln \left (c+d\,x+1\right )}{2\,c\,f^2+2\,f^2-2\,d\,e\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________